package com.blockmeta.bbs.baselibrary.runtime.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment

abstract class Btc8Fragment : Fragment() {
    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        val root = onCreateViewInner(inflater, container, savedInstanceState)
        root?.run { initView(this) }
        return root
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        onActivityCreatedInner(savedInstanceState)
        initData()
    }

    open fun initView(root: View) {}
    open fun initData() {}
    open fun onActivityCreatedInner(savedInstanceState: Bundle?) {}
    abstract fun onCreateViewInner(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?
}